require('page/common/header/index.js')
var _catalog_service = require('service/catalog-service.js');
const _util = require('../../../util/util');

require('../../common/header/index.js')
var _account_service=require('../../../service/account-service.js')
var $=require('jquery');

var _search={
    init:function(){
        this.loadInfo();
        this.bindEvents();
        return this;
    },

    loadInfo:function(){
        let productList=JSON.parse(sessionStorage.getItem('searchProductList'));
        let add='';
        productList.forEach(element => {
            add+='<tr>';
            add+=`<td>
                <img src="../${element.image}"/>
                <a href="../../../view/catalog/catalog-list.html?productId=${element.productId}&route=item">
                ${element.description} </a>
                </td>`
            add+=`<td>
                <b><font color="BLACK">${element.productId}</font></b>
                </td>`
            add+=`<td>${element.name}</td>`
            add+='</tr>';
        });
        $('#showTable').append(add);
    },

    bindEvents:function(){}

}

module.exports=_search.init()
